package com.wondream.java.io.example.file;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.ibatis.io.Resources;

import java.io.File;
import java.nio.charset.StandardCharsets;
import java.util.List;

public class IOUtilsTest {

    public static final String FILE_NAME = "application.yml";

    public static void main(String[] args) throws Exception {
        File resourceAsFile = Resources.getResourceAsFile(FILE_NAME);
        List<String> lines = IOUtils.readLines(FileUtils.openInputStream(resourceAsFile), StandardCharsets.UTF_8);
        System.out.println(String.join(System.lineSeparator(), lines));
    }
}
